package xju_9_10.entity;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component("stu")
public class Student {
    @Value("Java")
    private String msg;
    @Value("lisi")
    private String name;
    @Value("10")
    private int age;
    @Value("123")
    private String sn;

    public Student() {
        System.out.println("student 创建了");
    }

    public Student(String msg, String name, int age, String sn) {
        this.msg = msg;
        this.name = name;
        this.age = age;
        this.sn = sn;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getSn() {
        return sn;
    }

    public void setSn(String sn) {
        this.sn = sn;
    }

    // 普通方法
    public void study(){
        System.out.println("学习 -"+msg);
    }

    @Override
    public String toString() {
        return "Student{" +
                "msg='" + msg + '\'' +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", sn='" + sn + '\'' +
                '}';
    }
}
